<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
  
  <head>
    <meta charset="UTF-8">
    <title>欢迎页面-X-admin2.0</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="/css/font.css">
    <link rel="stylesheet" href="/css/xadmin.css">
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script type="text/javascript" src="/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="/js/xadmin.js"></script>
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
      <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
      <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>
  
  <body>
  	
    <div class="x-nav">
      <span class="layui-breadcrumb">
        <a href="">首页</a>
        <a href="">办公</a>
        <a>
          <cite>我的文档</cite></a>
      </span>
      <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
        <i class="layui-icon" style="line-height:30px">ဂ</i></a>
    </div>
    <div class="x-body">
      
      <xblock>
        <div class="layui-btn-group demoTable">
        <button class="layui-btn" ><i class="layui-icon">&#xe603</i>返回</button>
        <button class="layui-btn" onclick="x_admin_show('新建文件夹','/dwpage/singjian.html',700,200)"><i class="layui-icon">&#xe608;</i>新建文件夹</button>
        <button class="layui-btn" onclick="x_admin_show('移动','/admin-add.html')"><i class="layui-icon">&#xe609;</i>移动</button>
        <button class="layui-btn" onclick="x_admin_show('上传文件','/dwpage/upload.html',700,550)"><i class="layui-icon">&#xe67c;</i>上传文件</button>
        <button class="layui-btn" onclick="x_admin_show('搜索','/dwpage/shousuo.html',700,200)"><i class="layui-icon">&#xe615;</i>搜索</button>
        <button class="layui-btn" data-type="getCheckData" ><i class="layui-icon">&#xe613;</i>设置为共享</button>
        <button class="layui-btn" ><i class="layui-icon">&#x1007;</i>取消共享</button>
        </div>
      </xblock>
      <table class="layui-table" lay-data="{width: 892, height:332, url:'/dw/docmy/list/0', page:true, id:'idTest'}" lay-filter="demo">
        <thead>
        <tr>
          <th lay-data="{type:'checkbox', fixed: 'left'}"></th>
          <th lay-data="{field:'id', width:80, sort: true, fixed: true}">ID</th>
          <th lay-data="{field:'fileName', width:180, sort: true, fixed: true, templet: '#titleTpl'}">文件名</th>
          <th lay-data="{field:'isfile', width:100}">是否是文件</th>
          <th lay-data="{field:'fileSize', width:100, sort: true}">文件大小</th>
          <th lay-data="{field:'lastTime', width:180}">最后修改时间</th>
          <th lay-data="{field:'type', width:100, sort: true}">文件类型</th>
        </tr>
        </thead>
      </table>


    </div>
    <script>
        layui.use('table', function(){
            var table = layui.table;

            var $ = layui.$, active = {
                getCheckData: function(){ //获取选中数据
                    var checkStatus = table.checkStatus('idTest')
                        ,data = checkStatus.data;
                    var ids=new Array(data.length);
                    $.each(data,function (n, value) {
                        ids[n]=value.id;
                        console.log(value.id);
                        console.log(ids);
                    })
                }
            };



                $('.demoTable .layui-btn').on('click', function(){
                var type = $(this).data('type');
                active[type] ? active[type].call(this) : '';
            });
        });
    </script>

    <script type="text/html" id="titleTpl">
      {{#  if(d.isfile == 0){ }}
      <a href="/detail/{{d.id}}" class="layui-table-link"><img src="/dwpage/images/folder.gif">{{d.fileName}}</a>
      {{#  } else { }}
      <a href="/dw/docmy/download?id={{d.id}}" class="layui-table-link"><img src="/dwpage/images/pdf.gif">{{d.fileName}}</a>
      {{#  } }}
    </script>

  </body>

</html>